/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author T.Ron
 */
@Entity
@Table(name = "SECTIONANAL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sectionanal.findAll", query = "SELECT s FROM Sectionanal s"),
    @NamedQuery(name = "Sectionanal.findByIdSa", query = "SELECT s FROM Sectionanal s WHERE s.idSa = :idSa"),
    @NamedQuery(name = "Sectionanal.findBySa", query = "SELECT s FROM Sectionanal s WHERE s.sa = :sa"),
    @NamedQuery(name = "Sectionanal.findByIntitulesa", query = "SELECT s FROM Sectionanal s WHERE s.intitulesa = :intitulesa")})
public class Sectionanal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_SA")
    private Integer idSa;
    @Basic(optional = false)
    @Column(name = "SA")
    private String sa;
    @Basic(optional = false)
    @Column(name = "INTITULESA")
    private String intitulesa;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sa")
    private Collection<Comptea> compteaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sa")
    private Collection<Postebudgetaire> postebudgetaireCollection;

    public Sectionanal() {
    }

    public Sectionanal(Integer idSa) {
        this.idSa = idSa;
    }

    public Sectionanal(Integer idSa, String sa, String intitulesa) {
        this.idSa = idSa;
        this.sa = sa;
        this.intitulesa = intitulesa;
    }

    public Integer getIdSa() {
        return idSa;
    }

    public void setIdSa(Integer idSa) {
        this.idSa = idSa;
    }

    public String getSa() {
        return sa;
    }

    public void setSa(String sa) {
        this.sa = sa;
    }

    public String getIntitulesa() {
        return intitulesa;
    }

    public void setIntitulesa(String intitulesa) {
        this.intitulesa = intitulesa;
    }

    @XmlTransient
    public Collection<Comptea> getCompteaCollection() {
        return compteaCollection;
    }

    public void setCompteaCollection(Collection<Comptea> compteaCollection) {
        this.compteaCollection = compteaCollection;
    }

    @XmlTransient
    public Collection<Postebudgetaire> getPostebudgetaireCollection() {
        return postebudgetaireCollection;
    }

    public void setPostebudgetaireCollection(Collection<Postebudgetaire> postebudgetaireCollection) {
        this.postebudgetaireCollection = postebudgetaireCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSa != null ? idSa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sectionanal)) {
            return false;
        }
        Sectionanal other = (Sectionanal) object;
        if ((this.idSa == null && other.idSa != null) || (this.idSa != null && !this.idSa.equals(other.idSa))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.Sectionanal[ idSa=" + idSa + " ]";
    }
    
}
